
Imports DTO
Imports BUS

Public Class frmTHEMKHACHHANG

    Sub rong()

        txt_TenKH.Text = ""
        txt_diachi.Text = ""
        txt_sdt.Text = ""

    End Sub
    Private Sub btt_them_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub btn_them_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_them.Click
        Dim _khbus As New KhachHangBUS
        Dim KHdto As New KhachHangDTO
        KHdto.TenKH = txt_TenKH.Text
        KHdto.DiaChi = txt_diachi.Text
        KHdto.SDT = txt_sdt.Text
        KHdto.MaHD = txt_maloai.Text
        _khbus.ThemKH(KHdto)
        LoadDSKH()
        MessageBox.Show("Da Them Thanh Cong")
    End Sub


    Public Sub LoadDSKH()
        dgv_ThongTinKH.DataSource = KhachHangBUS.LayTATCa()
    End Sub
    Private Sub btn_Nhaplai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Nhaplai.Click
        rong()
    End Sub

    Private Sub Label6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub frmTHEMKHACHHANG_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadDSKH()
    End Sub

    Private Sub btn_thoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_thoat.Click
        Me.Close()
    End Sub
End Class